package com.jyxd.web.dao.basic;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jyxd.web.data.basic.NurseRecordForm;
import com.jyxd.web.data.dto.InOutAmountAllSumDTO;
import com.jyxd.web.data.dto.InOutAmountStatisticRequestDTO;
import com.jyxd.web.data.dto.InOutAmountStatisticReturnDTO;
import com.jyxd.web.data.dto.VitalSignsStatisticDataDTO;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface NurseRecordFormDao extends BaseMapper<NurseRecordForm> {

    /**
     * 新增一条护理单表记录
     *
     * @param nurseRecordForm
     * @return boolean
     */
    int insert(NurseRecordForm nurseRecordForm);

    /**
     * 更新一条护理单表记录
     *
     * @param nurseRecordForm
     * @return boolean
     */
    boolean update(NurseRecordForm nurseRecordForm);

    /**
     * 根据主键id查询一条护理单表记录
     *
     * @param id
     * @return NurseRecordForm
     */
    NurseRecordForm queryData(String id);

    /**
     * 根据条件分页查询护理单表记录列表
     *
     * @param map
     * @return list
     */
    List<NurseRecordForm> queryList(Map<String, Object> map);

    /**
     * 查询总出量
     *
     * @param map
     * @return
     */
    List<Map<String, Object>> queryOutPutSum(Map<String, Object> map);

    /**
     * 根据条件查询列表总记录数
     *
     * @param map
     * @return
     */
    int queryNum(Map<String, Object> map);

    /**
     * 根据患者id和时间查询生命体征数据
     *
     * @param map
     * @return
     */
    NurseRecordForm queryByPatientAndDataTime(Map<String, Object> map);

    /**
     * 根据父级id查询唯一一条沿用数据
     *
     * @param parentId
     * @return
     */
    NurseRecordForm queryByParentId(String parentId);

    /**
     * 出入量按小时或者按天统计
     *
     * @param inOutAmountStatisticRequestDTO
     * @return InOutAmountStatisticReturnDTO
     */
    InOutAmountAllSumDTO getInAndOutTotal(InOutAmountStatisticRequestDTO inOutAmountStatisticRequestDTO);

    /**
     * 出入量按小时或者按天统计
     *
     * @param inOutAmountStatisticRequestDTO
     * @return InOutAmountStatisticReturnDTO
     */
    List<InOutAmountStatisticReturnDTO> statisticData(InOutAmountStatisticRequestDTO inOutAmountStatisticRequestDTO);

    /**
     * 查询最新点的一条数据
     * @param map
     * @return
     */
    NurseRecordForm queryByPatientIdNewData(Map<String, Object> map);

    /**
     * 查询一小时内的数据
     * @param map
     * @return
     */
    NurseRecordForm queryByPatientIdAndTimeData(Map<String, Object> map);

    int updateCareInfo(NurseRecordForm nurseRecordForm);

    int batchUpdateField(Map<String, Object> map);

    List<String> getFieldList(Map<String, Object> map);

    List<VitalSignsStatisticDataDTO> statisticVitalSigns(Map<String, Object> map);
}
